﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Terraria.Graphics.Capture
{
	// Token: 0x020003AC RID: 940
	public class CaptureManager
	{
		// Token: 0x17000233 RID: 563
		// (get) Token: 0x060020EA RID: 8426 RVA: 0x00017107 File Offset: 0x00015307
		public bool IsCapturing
		{
			get
			{
				return this._camera.IsCapturing;
			}
		}

		// Token: 0x17000234 RID: 564
		// (get) Token: 0x060020EB RID: 8427 RVA: 0x00017114 File Offset: 0x00015314
		// (set) Token: 0x060020EC RID: 8428 RVA: 0x00017121 File Offset: 0x00015321
		public bool Active
		{
			get
			{
				return this._interface.Active;
			}
			set
			{
				if (Main.CaptureModeDisabled)
				{
					return;
				}
				if (this._interface.Active != value)
				{
					this._interface.ToggleCamera(value);
				}
			}
		}

		// Token: 0x17000235 RID: 565
		// (get) Token: 0x060020ED RID: 8429 RVA: 0x00017145 File Offset: 0x00015345
		public bool UsingMap
		{
			get
			{
				return this.Active && this._interface.UsingMap();
			}
		}

		// Token: 0x060020EE RID: 8430 RVA: 0x0001715C File Offset: 0x0001535C
		public CaptureManager()
		{
			this._interface = new CaptureInterface();
			this._camera = new CaptureCamera(Main.instance.GraphicsDevice);
		}

		// Token: 0x060020EF RID: 8431 RVA: 0x00017184 File Offset: 0x00015384
		public void Scrolling()
		{
			this._interface.Scrolling();
		}

		// Token: 0x060020F0 RID: 8432 RVA: 0x00017191 File Offset: 0x00015391
		public void Update()
		{
			this._interface.Update();
		}

		// Token: 0x060020F1 RID: 8433 RVA: 0x0001719E File Offset: 0x0001539E
		public void Draw(SpriteBatch sb)
		{
			this._interface.Draw(sb);
		}

		// Token: 0x060020F2 RID: 8434 RVA: 0x000171AC File Offset: 0x000153AC
		public float GetProgress()
		{
			return this._camera.GetProgress();
		}

		// Token: 0x060020F3 RID: 8435 RVA: 0x00460790 File Offset: 0x0045E990
		public void Capture()
		{
			CaptureSettings settings = new CaptureSettings
			{
				Area = new Rectangle(2660, 100, 1000, 1000),
				UseScaling = false
			};
			this.Capture(settings);
		}

		// Token: 0x060020F4 RID: 8436 RVA: 0x000171B9 File Offset: 0x000153B9
		public void Capture(CaptureSettings settings)
		{
			this._camera.Capture(settings);
		}

		// Token: 0x060020F5 RID: 8437 RVA: 0x000171C7 File Offset: 0x000153C7
		public void DrawTick()
		{
			this._camera.DrawTick();
		}

		// Token: 0x04003D6E RID: 15726
		public static CaptureManager Instance = new CaptureManager();

		// Token: 0x04003D6F RID: 15727
		private CaptureInterface _interface;

		// Token: 0x04003D70 RID: 15728
		private CaptureCamera _camera;
	}
}
